#ifndef COLLISION_H
#define COLLISION_H

#include "object.h"

#ifndef GENESIS_DATATYPES
#define GENESIS_DATATYPES
typedef unsigned char byte;
typedef unsigned short word;
#endif

void ColIndexLoad(byte);

word *FindNearestTile(object *obj, word obYBottom, word obX);
word *FindFloor(object *obj, word obYBottom, word obX, byte solidnessBit, word collisionFlags, signed short &floorDist, word offset, signed short *v_anglebufferPtr);
word *FindFloor2(object *obj, word obYBottom, word obX, byte solidnessBit, word collisionFlags, signed short &floorDist, signed short *v_anglebufferPtr);
word *FindWall(object *obj, word obYBottom, word obX, byte solidnessBit, word collisionFlags, signed short &wallDist, word offset, signed short *v_anglebufferPtr);
word *FindWall2(object *obj, word obYBottom, word obX, byte solidnessBit, word collisionFlags, signed short &wallDist, signed short *v_anglebufferPtr);

long SolidObject(object *obj, word width, word jumpHeight, word walkHeight, word xpos);

void PlatformObject(object *obj, word dist);
void Plat_NoXCheck(object *obj);
void loc_74AE(object *obj);
bool ExitPlatform(object *platform, word actionWidth, signed short &distPlayerLPlatformX);
bool ExitPlatform2(object *platform, word actionWidth, word actionWidth2, signed short &distPlayerLPlatformX);

long ReactToItem();
bool TestCollision(object *obj, byte obColType, word d4, word playerHeight, signed short playerXBehind, signed short playerYAbove);

void React_Monitor(object *monitor);
void React_Enemy(object *enemy);
void React_Caterkiller(object *caterkiller);
long React_ChkHurt(object *enemy);

long HurtSonic(object *victim);

#endif
